package com.elomobile.harmony;

import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.elomobile.utilitaire.sgbd2.Sgbdr;

public class DemarrageHarmony {
	/** Déclaration du logger */
	static Logger logger;

	/**
	 * Constructeur de la classe HarmonyTraitement
	 */
	public DemarrageHarmony() {

	}

	// Main du service
	public static void main(String args[]) {
		if (args.length > 0) {
			System.out.println("Chemin de bdd.ini : " + args[0]);
			while (!Sgbdr.bdd().connecter(args[0])) {
				try {
					Thread.sleep(10000);
				} catch (InterruptedException ex) {
					ex.printStackTrace();
				}
			}
		} else {
			while (!Sgbdr.bdd().connecter()) {
				try {
					Thread.sleep(10000);
				} catch (InterruptedException ex) {
					ex.printStackTrace();
				}
			}
		}

		new ClassPathXmlApplicationContext("com/elomobile/harmony/applicationContext.xml");
	}
}
